home *** CD-ROM | disk | FTP | other *** search
/ SGI Enlighten DSM 1.1 / SGI EnlightenDSM 1.1.iso / sco5x / emd / bin / postinstall_sysadm < prev    next >
Text File  |  1998-07-01  |  2KB  |  140 lines

  1. #!/bin/sh  
  2. #
  3. # Copyright (c) 1990-1998 Enlighten Software Solutions, Inc.
  4. #            -- All Rights Reserved --
  5. #
  6. # usage:  $0 upgrade_flag (0=install, 1=upgrade) 
  7. #
  8.  
  9. umask 077
  10.  
  11. PATH=/bin:/usr/bin:/etc:/usr/ucb:/usr/bsd:/usr/etc:$PATH ; export PATH
  12.  
  13. exit_code=0 ; export exit_code
  14. appName=`basename $0`
  15. os_name=`uname -s`
  16. os_release=`uname -r`
  17.  
  18. upgrade=0
  19.  
  20. if [ "$#" -ge 1 ] ; then
  21.     upgrade=$1
  22. fi
  23.  
  24. #
  25. # determine what ps options to use.
  26. # All systems use "-e" expcept for
  27. # SunOS 4.1.3 and 4.1.4 that use -auxww
  28. #
  29.  
  30. ps_opts="-e"
  31.  
  32. if [ "$os_name" = "SunOS" ] ; then
  33.     case "$os_release" in
  34.         4.1.* )
  35.             ps_opts="-auxww" ;;
  36.         * ) ;;
  37.     esac
  38. fi
  39.  
  40. error_check () {
  41.     if [ $? -ne 0 ] ; then
  42.         echo "$appName: Fatal: Could not successfully finish configuring EMD." 1>&2
  43.         exit 1
  44.     fi
  45. }
  46.  
  47. if [ -z "$ENLIGHTEN" ] ; then
  48.     echo "$appName: Fatal: The ENLIGHTEN variable was not set. " 1>&2
  49.     exit 1
  50. fi
  51.  
  52. #
  53. # make sure we are in the right directory
  54. #
  55.  
  56. cd $ENLIGHTEN
  57.  
  58. for i in bin/script1 bin/script2 ; do
  59.     if [ -f $i ] ; then
  60.         chown root $i
  61.         chmod 700 $i
  62.     fi
  63. done
  64.  
  65. #
  66. # ensure correct permissions on some directories
  67. #
  68.  
  69. for i in bin config \
  70.     config/backup/8mm \
  71.     config/backup/cart \
  72.     config/backup/jobs \
  73.     config/backup/log \
  74.     config/backup/logfiles \
  75.     config/backup/raw \
  76.     config/backup/reel \
  77.     config/backup/regular \
  78.     config/backup/table \
  79.     config/defaultpool \
  80.     config/formlet \
  81.     config/overrides \
  82.     config/rfd \
  83.     config/rfd/jobs \
  84.     config/rfd/logfiles \
  85.     config/userauth \
  86.     config/wxy \
  87.     secure \
  88.     lpr \
  89.     maps \
  90.     msg msg/C \
  91.     tmp \
  92.     work \
  93.     .data
  94. do
  95.     if [ ! -d $i ] ; then
  96.         mkdir -p $i
  97.     fi
  98.     chmod 700 $i
  99. done
  100.  
  101. # any user needs to be able write xenln and sm log files
  102. # same for rfd log files
  103. for i in logs config/rfd/logfiles
  104. do
  105.     chmod 700 $i
  106. done
  107.  
  108. # make form letters writable by group
  109. i=config/formlet/*
  110. chmod 600 $i
  111.  
  112. chmod 700 tmp
  113. chmod 700 scripts
  114.  
  115. # make this file writable by group
  116. # assume the group exists or was created above
  117. # the file is not there on DEC OSF1
  118. i=config/winn.out
  119. if [ -f $i ] ; then
  120.     chmod 600 $i
  121. fi
  122.  
  123. #
  124. # Setup default pool
  125. #
  126. uname -n > netgroup/default
  127.  
  128. #echo "Running diagnostic program to check installation."
  129.  
  130. bin/e_diag
  131.  
  132. if [ $? -ne 0 ] ; then
  133.     echo "The diagnostic program discovered some potential problems." 1>&2
  134.     echo "Please call Enlighten Software Support for assistance." 1>&2
  135.     exit 1
  136. fi
  137.  
  138. exit 0
  139.  
  140.